package com.jh.channel.repository;

import com.jh.channel.pojo.fastsilver.FastSilverOrder;
import com.jh.channel.pojo.fastsilver.OrderStatus;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Repository
public interface FastSilverRepository extends JpaRepository<FastSilverOrder,String>,JpaSpecificationExecutor<FastSilverOrder> {

    FastSilverOrder findByOrderNo(String orderNo);

    List<FastSilverOrder> findByOrderNoIn(List<String> orderNo);

    @Query("select fastSilverOrder from  FastSilverOrder fastSilverOrder where fastSilverOrder.orderStatus=:orderStatus and fastSilverOrder.createTime<=:createTime")
    List<FastSilverOrder> findByOrderList(@Param("orderStatus") OrderStatus orderStatus,@Param("createTime") Date createTime);


}
